#!/usr/bin/env python
import logging

bindIP = ' '  #Bind to which interface
bindPort = 21   #port to listen
dbhost = ' '  #Database server
dbuser = ' ' #user for database
dbpasswd = ' ' #password for db user
dbname = ' ' #database name

PassiveRangePort = [60000, 65535]  #random port range for passive ftp

GlobalDownloadLimit = 100 # KBytes/s
GlobalUploadLimit = 10 # MBytes/s
AttachUploadLimit = 1 # MBytes/s

timeout = 60

motd = 'Welcome to PyFtpd 0.3b. Bug report: chenhuan0@gmail.com'

run_as_user = 'qshftpd'
run_as_group = 'qshftpd'

logfile = '/var/log/qshftpd/qshftpd.log'

LOG_LEVEL = logging.DEBUG

FREE = False

ATTACH_FILETYPE = ['avi', 'wmv', 'rm', 'rmvb', 'flv', 'swf', '3gp', \
        'wma', 'mp3', 'rar', 'zip', '7z', 'tar', 'tar.gz', 'tar.bz2']
ATTACH_MAXSIZE = 100  # MB

permission = { # groups permission
        'download':{
            'home': '/home/ftp',
            'perm':'elr', #basic permission
            'operms':  {'/home/ftp/ACG/Upload':'el',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',
                        '/home/ftp/Game/Upload':'el',
                        '/home/ftp/Music/Upload':'el',
                        '/home/ftp/Sport/Upload':'el',
                        '/home/ftp/Study/Upload':'el',
                        '/home/ftp/Video/Upload':'el',
            },
            'download_limit': 400, # KBytes/s
            'max_cons_per_user': 1},
        'free':{
            'home': '/home/ftp',
            'perm':'elr', #basic permission
            'operms':  {'/home/ftp/ACG/Upload':'el',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',
                        '/home/ftp/Game/Upload':'el',
                        '/home/ftp/Music/Upload':'el',
                        '/home/ftp/Sport/Upload':'el',
                        '/home/ftp/Study/Upload':'el',
                        '/home/ftp/Video/Upload':'el',
            },
            'download_limit': 300, # KBytes/s
            'max_cons_per_user': 1},
        'superuser':{
            'home': '/home/ftp',
            'perm':'cdeflmpr', #basic permission
            'operms':  {},
            'download_limit': 102400, # KBytes/s
            'max_cons_per_user': 1000},
        'admin_acg':{
            'home': '/home/ftp',
            'perm':'elr', #basic permission
            'operms':  {'/home/ftp/ACG':'cdeflmpr',
                        '/home/ftp/ACG/Private':'cdeflmpr',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 4},
        'admin_game':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Game':'cdeflmpr',
                       '/home/ftp/ACG/Private':'',
                       '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 4},
        'admin_music':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Music':'cdeflmpr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 4},
        'admin_sport':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Sport':'cdeflmpr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 4},
        'admin_study':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Study':'cdeflmpr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 4},
        'admin_video':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Video':'cdeflmpr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 4},
        'resource_acg':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/ACG':'ceflmr',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
        'resource_game':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Game':'ceflmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
        'resource_music':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Music':'ceflmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
        'resource_sport':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Sport':'ceflmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
        'resource_study':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Study':'ceflmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
        'resource_video':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Video':'ceflmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
        'upload_acg':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/ACG/Upload':'celmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes
            'max_cons_per_user': 2},
        'upload_game':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Game/Upload':'celmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
        'upload_music':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Music/Upload':'celmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes
            'max_cons_per_user': 2},
        'upload_sport':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Sport/Upload':'celmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
        'upload_study':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Study/Upload':'celmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
        'upload_video':{
            'home': '/home/ftp',
            'perm':'elr',
            'operms': {'/home/ftp/Video/Upload':'celmr',
                        '/home/ftp/ACG/Private':'',
                        '/home/ftp/System':'',},
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
        'attach':{
            'home': '/home/www/attach',
            'download_limit': 500, # KBytes/s
            'max_cons_per_user': 2},
    }
